<?php


namespace App\Http\Requests\Admin;


use Illuminate\Foundation\Http\FormRequest;

class ProductSiteInputDTO extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        $id = $this->route('id');
        return [
            'name' => 'required|max:20|unique:product_sites,name,'.$id,
            'cover' => 'max:200'
        ];
    }

    public function messages()
    {
        return [
            'name.required' => '名称不能为空',
            'name.max' => '名称参数错误',
            'name.unique' => '名称不能重复',
            'cover.max' => '图片不能参数错误',
        ];
    }
}